package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;

import jpa.entitys.common.CommonEntity;


/**
 * The persistent class for the COST_ARTICLE database table.
 * 
 */
@Entity
@Table(name="COST_ARTICLE")
@NamedQueries({
    @NamedQuery(name = "CostArticle.findAll", query = " SELECT c FROM CostArticle c "),
    @NamedQuery(name = "CostArticle.findById", query = " SELECT c FROM CostArticle c WHERE c.articleCode = :Id "),
    @NamedQuery(name = "CostArticle.findByItemType", query = " SELECT c FROM CostArticle c WHERE c.itemType = :itemType "),
    @NamedQuery(name = "CostArticle.findByArticleType", query = " SELECT c FROM CostArticle c WHERE c.articleType = :articleType ")
})
public class CostArticle extends CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="ARTICLE_CODE", unique=true, nullable=false, length=30)
	private String articleCode;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	public String getArticleCode() {
		return this.articleCode;
	}
	public void setArticleCode(String articleCode) {
		this.articleCode = articleCode;
	}

	@Column(name="ARTICLE_TYPE", length=1)
	private String articleType;

	@Column(name="CHILD_CODE", length=30)
	private String childCode;

	@Column(name="COST_PER_UNIT", length=1)
	private String costPerUnit;

	@Column(name="CREATED_BY", length=30)
	private String createdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

	@Column(name="DEPRECIATION_PERIOD", precision=22)
	private BigDecimal depreciationPeriod;

	@Column(name="DEPRECIATION_RATE", precision=22)
	private BigDecimal depreciationRate;

	@Column(name="DEPRECIATION_TYPE", length=30)
	private String depreciationType;

	@Column(length=300)
	private String description;

	@Column(name="DESCRIPTION_TH", length=300)
	private String descriptionTh;

	@Column(name="IMPORT_LAB_COST_CODE", length=30)
	private String importLabCostCode;

	@Column(name="IMPORT_MAT_COST_CODE", length=30)
	private String importMatCostCode;

	@Column(name="IMPORT_TRANSPORT_COST_CODE", length=30)
	private String importTransportCostCode;

	@Column(name="ITEM_TYPE", length=2)
	private String itemType;

	@Column(name="LAST_UPD_BY", length=30)
	private String lastUpdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LAST_UPD_ON")
	private Date lastUpdOn;

	@Column(precision=22)
	private BigDecimal leadtime;

	@Column(name="LOCAL_LAB_COST_CODE", length=30)
	private String localLabCostCode;

	@Column(name="LOCAL_MAT_COST_CODE", length=30)
	private String localMatCostCode;

	@Column(name="LOCAL_TRANSPORT_COST_CODE", length=30)
	private String localTransportCostCode;

	@Column(name="MIN_LEVEL", precision=22)
	private BigDecimal minLevel;

	@Column(name="PARENT_CODE", length=30)
	private String parentCode;

	@Column(name="PR_FLAG", length=1)
	private String prFlag;

	@Column(name="REF_ARTICLE_CODE", length=30)
	private String refArticleCode;

	@Column(name="REF_ARTICLE_GROUP", length=30)
	private String refArticleGroup;

	@Column(name="REF_ARTICLE_SUB_GROUP", length=30)
	private String refArticleSubGroup;

	@Column(name="REF_ARTICLE_TYPE", length=30)
	private String refArticleType;

	@Column(name="REF_ID", precision=10)
	private BigDecimal refId;

	@Column(name="REORDER_QTY", precision=22)
	private BigDecimal reorderQty;

	@Column(name="SEQ_NO", precision=22)
	private BigDecimal seqNo;

	@Column(length=1)
	private String status;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_EXTERNAL_REF_KEY", length=100)
	private String syncExternalRefKey;

	@Column(name="SYNC_EXTERNAL_REF_NO", length=100)
	private String syncExternalRefNo;

	@Column(name="SYNC_ISSYNC", length=1)
	private String syncIssync;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(length=30)
	private String um;

	@Column(name="VALUATION_METHOD", length=30)
	private String valuationMethod;
	
	@Column(name="PRODUCT_TYPE", length=100)
	private String productType;
	
	@Column(name="PRODUCT_CODE", length=150)
	private String productCode;
	
	@Column(name="MODEL_CODE", length=150)
	private String modelCode;
	
	@Column(name="BRAND_NAME", length=300)
	private String brandName;
	
	@Column(name="MATERIAL_TYPE", length=250)
	private String materialType;
	
	@Column(name="PRODUCT_COLOR", length=250)
	private String productColor;
	
	@Column(name="PRODUCT_SIZE", length=250)
	private String productSize;
	
	@Column(name="INSTALL_LOCATION", length=300)
	private String installlocation;
	
	@Column(name="PRODUCT_DETAILS", length=500)
	private String productdetail;

	@Column(name="MANUFACTURES", length=300)
	private String manufactures;
	
	@Column(name="PICTURE_PATH", length=300)
	private String picturepath;
	
	@Column(name="ARTICLE_GROUP")
	private String articleGroup;

	@Column(name="ARTICLE_SUB_GROUP")
	private String articleSubGroup;
	
	public String getArticleGroup() {
		return this.articleGroup;
	}
	public void setArticleGroup(String articleGroup) {
		this.articleGroup = articleGroup;
	}
	public String getArticleSubGroup() {
		return this.articleSubGroup;
	}
	public void setArticleSubGroup(String articleSubGroup) {
		this.articleSubGroup = articleSubGroup;
	}
	
	/**
	 * @return the brandName
	 */
	public String getBrandName() {
		return brandName;
	}

	/**
	 * @param brandName the brandName to set
	 */
	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}

	/**
	 * @return the productType
	 */
	public String getProductType() {
		return productType;
	}

	/**
	 * @param productType the productType to set
	 */
	public void setProductType(String productType) {
		this.productType = productType;
	}

	/**
	 * @return the productCode
	 */
	public String getProductCode() {
		return productCode;
	}

	/**
	 * @param productCode the productCode to set
	 */
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	/**
	 * @return the modelCode
	 */
	public String getModelCode() {
		return modelCode;
	}

	/**
	 * @param modelCode the modelCode to set
	 */
	public void setModelCode(String modelCode) {
		this.modelCode = modelCode;
	}
	
	/**
	 * @return the materialType
	 */
	public String getMaterialType() {
		return materialType;
	}

	/**
	 * @param materialType the materialType to set
	 */
	public void setMaterialType(String materialType) {
		this.materialType = materialType;
	}

	/**
	 * @return the productColor
	 */
	public String getProductColor() {
		return productColor;
	}

	/**
	 * @param productColor the productColor to set
	 */
	public void setProductColor(String productColor) {
		this.productColor = productColor;
	}

	/**
	 * @return the productSize
	 */
	public String getProductSize() {
		return productSize;
	}

	/**
	 * @param productSize the productSize to set
	 */
	public void setProductSize(String productSize) {
		this.productSize = productSize;
	}

	/**
	 * @return the installlocation
	 */
	public String getInstalllocation() {
		return installlocation;
	}

	/**
	 * @param installlocation the installlocation to set
	 */
	public void setInstalllocation(String installlocation) {
		this.installlocation = installlocation;
	}

	/**
	 * @return the productdetail
	 */
	public String getProductdetail() {
		return productdetail;
	}

	/**
	 * @param productdetail the productdetail to set
	 */
	public void setProductdetail(String productdetail) {
		this.productdetail = productdetail;
	}

	/**
	 * @return the manufactures
	 */
	public String getManufactures() {
		return manufactures;
	}

	/**
	 * @param manufactures the manufactures to set
	 */
	public void setManufactures(String manufactures) {
		this.manufactures = manufactures;
	}

	/**
	 * @return the picturepath
	 */
	public String getPicturepath() {
		return picturepath;
	}

	/**
	 * @param picturepath the picturepath to set
	 */
	public void setPicturepath(String picturepath) {
		this.picturepath = picturepath;
	}

	@Column(name="VED_CODE", length=1)
	private String vedCode;

	//bi-directional many-to-one association to CostArticleSubGroup
    @ManyToOne
	@JoinColumns({
		@JoinColumn(name="ARTICLE_GROUP", referencedColumnName="ARTICLE_GROUP", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="ARTICLE_SUB_GROUP", referencedColumnName="ARTICLE_SUB_GROUP", nullable=false, insertable=false, updatable=false)
		})
	private CostArticleSubGroup costArticleSubGroup;

    public CostArticle() {
    }

	
	public String getArticleType() {
		return this.articleType;
	}

	public void setArticleType(String articleType) {
		this.articleType = articleType;
	}

	public String getChildCode() {
		return this.childCode;
	}

	public void setChildCode(String childCode) {
		this.childCode = childCode;
	}

	public String getCostPerUnit() {
		return this.costPerUnit;
	}

	public void setCostPerUnit(String costPerUnit) {
		this.costPerUnit = costPerUnit;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public BigDecimal getDepreciationPeriod() {
		return this.depreciationPeriod;
	}

	public void setDepreciationPeriod(BigDecimal depreciationPeriod) {
		this.depreciationPeriod = depreciationPeriod;
	}

	public BigDecimal getDepreciationRate() {
		return this.depreciationRate;
	}

	public void setDepreciationRate(BigDecimal depreciationRate) {
		this.depreciationRate = depreciationRate;
	}

	public String getDepreciationType() {
		return this.depreciationType;
	}

	public void setDepreciationType(String depreciationType) {
		this.depreciationType = depreciationType;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescriptionTh() {
		return this.descriptionTh;
	}

	public void setDescriptionTh(String descriptionTh) {
		this.descriptionTh = descriptionTh;
	}

	public String getImportLabCostCode() {
		return this.importLabCostCode;
	}

	public void setImportLabCostCode(String importLabCostCode) {
		this.importLabCostCode = importLabCostCode;
	}

	public String getImportMatCostCode() {
		return this.importMatCostCode;
	}

	public void setImportMatCostCode(String importMatCostCode) {
		this.importMatCostCode = importMatCostCode;
	}

	public String getImportTransportCostCode() {
		return this.importTransportCostCode;
	}

	public void setImportTransportCostCode(String importTransportCostCode) {
		this.importTransportCostCode = importTransportCostCode;
	}

	public String getItemType() {
		return this.itemType;
	}

	public void setItemType(String itemType) {
		this.itemType = itemType;
	}

	public String getLastUpdBy() {
		return this.lastUpdBy;
	}

	public void setLastUpdBy(String lastUpdBy) {
		this.lastUpdBy = lastUpdBy;
	}

	public Date getLastUpdOn() {
		return this.lastUpdOn;
	}

	public void setLastUpdOn(Date lastUpdOn) {
		this.lastUpdOn = lastUpdOn;
	}

	public BigDecimal getLeadtime() {
		return this.leadtime;
	}

	public void setLeadtime(BigDecimal leadtime) {
		this.leadtime = leadtime;
	}

	public String getLocalLabCostCode() {
		return this.localLabCostCode;
	}

	public void setLocalLabCostCode(String localLabCostCode) {
		this.localLabCostCode = localLabCostCode;
	}

	public String getLocalMatCostCode() {
		return this.localMatCostCode;
	}

	public void setLocalMatCostCode(String localMatCostCode) {
		this.localMatCostCode = localMatCostCode;
	}

	public String getLocalTransportCostCode() {
		return this.localTransportCostCode;
	}

	public void setLocalTransportCostCode(String localTransportCostCode) {
		this.localTransportCostCode = localTransportCostCode;
	}

	public BigDecimal getMinLevel() {
		return this.minLevel;
	}

	public void setMinLevel(BigDecimal minLevel) {
		this.minLevel = minLevel;
	}

	public String getParentCode() {
		return this.parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}

	public String getPrFlag() {
		return this.prFlag;
	}

	public void setPrFlag(String prFlag) {
		this.prFlag = prFlag;
	}

	public String getRefArticleCode() {
		return this.refArticleCode;
	}

	public void setRefArticleCode(String refArticleCode) {
		this.refArticleCode = refArticleCode;
	}

	public String getRefArticleGroup() {
		return this.refArticleGroup;
	}

	public void setRefArticleGroup(String refArticleGroup) {
		this.refArticleGroup = refArticleGroup;
	}

	public String getRefArticleSubGroup() {
		return this.refArticleSubGroup;
	}

	public void setRefArticleSubGroup(String refArticleSubGroup) {
		this.refArticleSubGroup = refArticleSubGroup;
	}

	public String getRefArticleType() {
		return this.refArticleType;
	}

	public void setRefArticleType(String refArticleType) {
		this.refArticleType = refArticleType;
	}

	public BigDecimal getRefId() {
		return this.refId;
	}

	public void setRefId(BigDecimal refId) {
		this.refId = refId;
	}

	public BigDecimal getReorderQty() {
		return this.reorderQty;
	}

	public void setReorderQty(BigDecimal reorderQty) {
		this.reorderQty = reorderQty;
	}

	public BigDecimal getSeqNo() {
		return this.seqNo;
	}

	public void setSeqNo(BigDecimal seqNo) {
		this.seqNo = seqNo;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncExternalRefKey() {
		return this.syncExternalRefKey;
	}

	public void setSyncExternalRefKey(String syncExternalRefKey) {
		this.syncExternalRefKey = syncExternalRefKey;
	}

	public String getSyncExternalRefNo() {
		return this.syncExternalRefNo;
	}

	public void setSyncExternalRefNo(String syncExternalRefNo) {
		this.syncExternalRefNo = syncExternalRefNo;
	}

	public String getSyncIssync() {
		return this.syncIssync;
	}

	public void setSyncIssync(String syncIssync) {
		this.syncIssync = syncIssync;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public String getUm() {
		return this.um;
	}

	public void setUm(String um) {
		this.um = um;
	}

	public String getValuationMethod() {
		return this.valuationMethod;
	}

	public void setValuationMethod(String valuationMethod) {
		this.valuationMethod = valuationMethod;
	}

	public String getVedCode() {
		return this.vedCode;
	}

	public void setVedCode(String vedCode) {
		this.vedCode = vedCode;
	}

	public CostArticleSubGroup getCostArticleSubGroup() {
		return this.costArticleSubGroup;
	}

	public void setCostArticleSubGroup(CostArticleSubGroup costArticleSubGroup) {
		this.costArticleSubGroup = costArticleSubGroup;
	}
	
}